Merged
Conversation
Contributor
|
PR 이전보다 구체적으로 작성해서 좋습니다 ~! 👍👍 |
kiteof-park
reviewed
Apr 14, 2025
| import org.springframework.context.annotation.Profile; | ||
|
|
||
| @Configuration | ||
| @Profile("!test") |
Contributor
There was a problem hiding this comment.
RedissonConfig에 @Profile("!test")를 사용한 이유가
테스트 코드 작성시에 RedissonConfig를 Mock으로 사용하기 위함인가요?
Contributor
Author
There was a problem hiding this comment.
네 이걸 사용하지 않으면 springboottest 시작시 테스트로 만든 것이 기존의 confiquration과 겹치거나 무시되서 사용했습니다.
kiteof-park
reviewed
Apr 14, 2025
Comment on lines
+113
to
+125
| User user = User.builder() | ||
| .loginId("testuser@example.com") // 로그인 아이디 (이메일 또는 소셜 ID) | ||
| .password("testPassword123!") // 비밀번호 (소셜 로그인은 null 가능) | ||
| .name("홍길동") // 이름 | ||
| .birthDate("1995-05-01") // 생년월일 | ||
| .gender("M") // 성별 (M/F) | ||
| .phone("010-1234-5678") // 휴대폰 번호 | ||
| .provider(LoginType.LOCAL) // 로그인 타입 (enum 값) | ||
| .ageAgreement(true) // 만 14세 이상 동의 | ||
| .useAgreement(true) // 서비스 이용 약관 동의 | ||
| .picAgreement(true) // 개인정보 처리 방침 동의 | ||
| .adAgreement(false) // 광고 수신 동의 | ||
| .build(); |
Contributor
There was a problem hiding this comment.
이런 코드에서는 fixture를 사용하는 방법도 있다고 알고있는데, 어떻게 생각하시나요?
Contributor
Author
There was a problem hiding this comment.
fixture 사용은 추후에 사용할 예정입니다!
Contributor
Author
There was a problem hiding this comment.
아직 다른 곳에서 재사용하지 않아서 필요시 만들 예정입니다.
Contributor
|
회원 테스트 코드를 어떻게 짤 수 있나 고민했는데 좋은 참고자료 감사합니다! 😊 |
KWAK-JINHO
reviewed
Apr 14, 2025
| Long result = 리뷰작성(request); | ||
|
|
||
| // then | ||
| Assertions.assertNotNull(result); |
Contributor
There was a problem hiding this comment.
여기서 리뷰가 null인지만 체크하면 좀 부족하지 않을까요 내용이 예상대로 들어갔는지 같은 좀 더 구체적인 검증이 추가되면 어떨까요?
soyun-i
approved these changes
Apr 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 어떤 기능을 구현했나요 ?
🔥 어떤 문제를 마주했나요 ?
@testinstance(TestInstance.Lifecycle.PER_CLASS) 의미
테스트 클래스 인스턴스를 한 번만 생성하고 재사용합니다.
✨ 어떻게 해결했나요 ?
Spring Session + Redis 구성은:
MockMvc.perform() → 내부적으로 SessionRepositoryFilter 가 동작
세션 객체를 Redis 기반으로 wrapping 해버림
네가 넣은 MockHttpSession이 아닌 Spring Session 관리 세션 사용됨
그래서 세션 값이 안들어가져서 Resolver를 mock으로 만들어 주입.
📝 어떤 부분에 집중해서 리뷰해야 할까요?
📚 참고 자료 및 회고